<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>常用解决延时</title>
    <script src="fastclick.js"></script>
</head>

<body>
    <div>123</div>
    <script>
        if ('addEventListener' in document) {
            // 等待dom元素加载后再执行 不用等图片加载完
            document.addEventListener('DOMContentLoaded', function () {
                FastClick.attach(document.body);
            }, false);
        }
        var div= document.querySelector('div')
        div.addEventListener('click',function(){
            alert(11)
        })
    </script>
</body>

</html>